package com.dongdongshop.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;


@Configuration
public class ItemPageConfigurer {

    //实例化freemarkerconfig
    @Bean
    public FreeMarkerConfigurer freeMarkerConfigurer() {
        FreeMarkerConfigurer configurer = new FreeMarkerConfigurer();
        //设置编码
        configurer.setDefaultEncoding("utf-8");
        //找到模板文件所在的路径 找到模板
        configurer.setTemplateLoaderPath("classpath:freemarker");
        return configurer;
    }
}
